package com.zyit.web;

import com.zyit.DataObject.T_user;
import com.zyit.dao.UserDao;

import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
@WebServlet("/forgotPassword")
public class ForgotPassword extends HttpServlet {
    UserDao userDao = new UserDao();
    @Override
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        System.out.println("进来了吗哥");
        String email = req.getParameter("email");
        System.out.println(email);
        T_user tUser = userDao.emailByUser(email);
        System.out.println(tUser);
            resp.getWriter().write("{\"status\": 1, \"account\": \"" + tUser.getAccount() + "\", \"email\": \"" + tUser.getEmail() + "\"}");




    }
}
